<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* DB Handler
*
* Functions Regarding Database Interactions and Abstraction
* 
* Provides the Crucial Bridge Layer Between "The Game" and the Database
* Architecture (This is our "Glue")
*/

class dbHandler {

	// Of course, everything above is aspirational. At the moment, we simply wish to instantiate a room.
	public static function loadGame() {
		$basic_room = new Room();
		$basic_room->name = "Outside Esquire's Tavern";
		$basic_room->description= "A rather gangly establishment by any measure, Esquire's is one hell of a bar. In any other bar, one's liable to get thrown out for what get's a guy invited in. It's a dive tavern just south of the center city. For residents of the east docks, Esquire's is usually the last stop on the tavern-hopping circuit - the place you go when you're almost too wasted to walk. It's a grimy spot with an L-shaped bar, travelers from all over because the booze are cheap, a few long tables and sawdust on the floor. Everything that hasn't been graffitied has been stolen. Still, Esquire's is a giant of city life, a place for picking up a feisty wench, throwing away your inhibitions and getting way too close to a guy who probably doesn't speak the queen's tongue. Like clockwork a mob of drunken revelers jostle to enter Esquire every Friday. The air inside is thick with the perspiration of way too many people to fit inside. Quite possibly, simply, the best place ever.";
		$basic_room->image="tavern1.jpg";
		
		$basic_exit = new Exit_();
		$basic_exit->setCommonExit(ENTER,"Esquire's Tavern","inside Esquire's Tavern");
		$basic_exit->description="That broken window near the door is STILL broken.";
		array_push($basic_room->exits,$basic_exit);
		array_push(world::$room_list,$basic_room);
		
		$basic_room2 = new Room();
		$basic_room2->name = "Inside Esquire's Tavern";
		$basic_room2->description= "Esquire's Tavern, home to some of the worst riff-raff on this side of the seven cities";
		$basic_room2->image="innertavern1.jpg";
		
		$basic_exit2 = new Exit_();
		$basic_exit2->setCommonExit(LEAVE,"Esquire's Tavern","outside Esquire's Tavern");
		$basic_exit2->description="A big oak door to the outside world.";
		array_push($basic_room2->exits,$basic_exit2);
		
		array_push(world::$room_list,$basic_room2);
		
		
		$basic_room3 = new Room();
		$basic_room3->name = "The Slums Near Esquire's Tavern";
		$basic_room3->description= "An alley near the dock's district where one's liable to find all sorts of interesting things.";
		$basic_room3->image="slum1.jpg";
		
		$basic_exit3 = new Exit_();
		$basic_exit3->setCommonExit(WEST);
		array_push($basic_room->exits,$basic_exit3);
		
		$basic_exit4 = new Exit_();
		$basic_exit4->setCommonExit(EAST);
		array_push($basic_room3->exits,$basic_exit4);
		
		array_push(world::$room_list,$basic_room3);
		
		
		
		// The less direct referencing we have, the easier this will be on the database...
		// Just a thought...
		$basic_exit4->to_room=$basic_room;
		$basic_exit3->to_room=$basic_room3;
		$basic_exit2->to_room=$basic_room;
		$basic_exit->to_room=$basic_room2;
		
	}
	
}

?>